function repeat_call(fn, time) {
  for (let i = 0; i < time; i++)
    fn()
}

function is_not_null(val) {
  return !is_null(val)
}

function is_null(val) {
  return val == null
}

function divided_fn(divisor) {
  return (dividend) => {
    return Math.floor(dividend / divisor)
  }
}

function zipmap(l1, l2) {
  return new Map(l1.map((val, i) => {
    return [val, l2[i]]
  }))
}

function nums_between(min, max) {
  const result = []
  for (let i = min; i <= max; i++)
    result.push(i)
  return result
}

function is_logined(req) {
  return req.session.user != null
}

function expired_result() {
  return {
    ok: false,
    msg: '创建房间必须先登录',
    code: 'expired'
  }
}

Object.assign(exports, { repeat_call, is_not_null, is_null, divided_fn, zipmap, nums_between, is_logined, expired_result })